package com.ruoyi.system.service.impl.config;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.config.VsAttachmentMapper;
import com.ruoyi.system.domain.config.VsAttachment;
import com.ruoyi.system.service.config.IVsAttachmentService;

/**
 * 附件Service业务层处理
 * 
 * @author zzx
 * @date 2024-06-13
 */
@Service
public class VsAttachmentServiceImpl implements IVsAttachmentService 
{
    @Autowired
    private VsAttachmentMapper vsAttachmentMapper;

    /**
     * 查询附件
     * 
     * @param id 附件主键
     * @return 附件
     */
    @Override
    public VsAttachment selectVsAttachmentById(String id)
    {
        return vsAttachmentMapper.selectVsAttachmentById(id);
    }

    /**
     * 查询附件列表
     * 
     * @param vsAttachment 附件
     * @return 附件
     */
    @Override
    public List<VsAttachment> selectVsAttachmentList(VsAttachment vsAttachment)
    {
        return vsAttachmentMapper.selectVsAttachmentList(vsAttachment);
    }

    /**
     * 新增附件
     * 
     * @param vsAttachment 附件
     * @return 结果
     */
    @Override
    public int insertVsAttachment(VsAttachment vsAttachment)
    {
        vsAttachment.setCreatetime(System.currentTimeMillis());
        vsAttachment.setUpdatetime(System.currentTimeMillis());
        vsAttachment.setUploadtime(System.currentTimeMillis());
        return vsAttachmentMapper.insertVsAttachment(vsAttachment);
    }

    /**
     * 修改附件
     * 
     * @param vsAttachment 附件
     * @return 结果
     */
    @Override
    public int updateVsAttachment(VsAttachment vsAttachment)
    {
        vsAttachment.setUpdatetime(System.currentTimeMillis());
        vsAttachment.setUploadtime(System.currentTimeMillis());
        return vsAttachmentMapper.updateVsAttachment(vsAttachment);
    }

    /**
     * 批量删除附件
     * 
     * @param ids 需要删除的附件主键
     * @return 结果
     */
    @Override
    public int deleteVsAttachmentByIds(String[] ids)
    {
        return vsAttachmentMapper.deleteVsAttachmentByIds(ids);
    }

    /**
     * 删除附件信息
     * 
     * @param id 附件主键
     * @return 结果
     */
    @Override
    public int deleteVsAttachmentById(String id)
    {
        return vsAttachmentMapper.deleteVsAttachmentById(id);
    }
}
